package com.yunhe.bean;

public class PageBean {
	
	static int pageNum=10;
	
	private int currentPage;
	
	private int startIndex; 
	
	private int totalPage; 
	
	private int records;
	

	public static int getPageNum() {
		return pageNum;
	}

	public static void setPageNum(int pageNum) {
		PageBean.pageNum = pageNum;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		
		this.startIndex=(currentPage-1)*pageNum;
		this.currentPage = currentPage;
	}

	public int getStartIndex() {
		return startIndex;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public int getRecords() {
		return records;
	}

	public void setRecords(int records) {
	
		if(records%pageNum==0){
			this.totalPage=records/pageNum;
		}else{
			this.totalPage=records/pageNum+1;
		}
		
		this.records = records;
	}

	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	@Override
	public String toString() {
		return "PageBean [currentPage=" + currentPage + ", startIndex=" + startIndex + ", totalPage=" + totalPage
				+ ", records=" + records + "]";
	}

	
	

}
